import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';

// 子component

import {UserListComponent} from './user-list/user-list.component'
import {UserViewComponent} from './user-view/user-view.component'

const routes: Routes = [
    {
        path: '',
        children: [
            {
                path: 'index',
                component: UserListComponent,
                data: {
                    title: '用户列表'
                }
            },
            {
                path: 'index/view/:id',
                component: UserViewComponent,
                data: {
                    title: '用户详情'
                }
            },
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class UserRoutingModule {
}
